<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新增岗位</title>
    <link href="../../resources/js/plugins/layui/css/layui.css" type="text/css" rel="stylesheet"  />
    <link href="../../resources/css/htmltyle.css" type="text/css" rel="stylesheet"  />
    <script type="text/javascript" src="../../resources/js/plugins/layui/layui.js"></script>
    <script type="text/javascript" src="../../resources/js/actions.js"></script>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space5" >
        <!--<div class="layui-col-sm3 ">
            <fieldset class="layui-elem-field">
                <legend>岗位模板</legend>
                <div class="layui-field-box">
                    <form class="layui-form">
                        <div class="layui-form-item " style="border: none;margin: 0px; padding: 0px;">

                                <div class=" layui-col-sm8">
                                    <input type="text"  name="search_jobname" id="search_jobname" placeholder="请输入" autocomplete="on" class="layui-input "   >
                                </div>
                                <div class="toolbars">
                                    <a id="flows_searchbtn" class="btn top3px">
                                        <em class="ico16 search_16"></em>
                                        <span class="menu_span" title="查询">查询</span>
                                    </a>
                                </div>
&lt;!&ndash;                               <div class=" layui-col-sm3" style="padding: 5px 0px 0px 10px;">&ndash;&gt;
&lt;!&ndash;                                   <a id="flows_searchbtn " type="button" class="layui-btn layui-btn-sm" style="height: 38px;line-height: 38px;background-color: #1E85EC!important;">&ndash;&gt;&ndash;&gt;
&lt;!&ndash;                                       <i class="layui-icon">&#xe615;</i>&ndash;&gt;
&lt;!&ndash;                                   </a>&ndash;&gt;
&lt;!&ndash;                               </div>&ndash;&gt;
                        </div>
                    </form>
                    <table id="jobsTempTable" class="layui-table"  lay-filter="jobsTempTable"></table>
                </div>

            </fieldset>
        </div>-->
        <div class="layui-col-sm3 ">
            <fieldset class="layui-elem-field">
                <legend>岗位模板</legend>
                <div class="layui-field-box">
                   <!-- <form class="layui-form">
                        <div class="layui-form-item " style="border: none;margin: 0px; padding: 0px;">
                            <div class=" layui-col-sm8">
                                <input type="text"  name="search_jobplanname" id="search_jobplanname" placeholder="请输入" autocomplete="on" class="layui-input "   >
                            </div>
                            <div class="toolbars">
                                <a id="flows_searchbtn" class="btn top3px">
                                    <em class="ico16 search_16"></em>
                                    <span class="menu_span" title="查询">查询</span>
                                </a>
                            </div>
                        </div>
                    </form>-->
                    <table id="jobsPlanTempTable" class="layui-table"  lay-filter="jobsPlanTempTable"></table>
                </div>

            </fieldset>
        </div>

        <div class="layui-col-sm8 layui-col-sm-offset1">
            <form class="layui-form layui-form-pane" action="" style="padding:10px" lay-filter="jobsForm" id="jobsForm">
                <div class="layui-form-item">
                    <label class="layui-form-label">招聘部门</label><!--<span style="color: red">*</span>-->
                    <div class="layui-input-block">
                       <!-- <input type="hidden"  name="jobdepart"  id="jobdepart">-->
                        <input type="text" name="jobdepart"  id="jobdepart"placeholder="请输入招聘部门"  class="layui-input"><!-- lay-verify="required"-->
                        <!--<select name="sjobdepart" id="sjobdepart" lay-verify="required"  lay-filter="one_cate">
                        </select>-->
                    </div>
                </div>
                <div class="layui-form-item">
                    <input type="hidden" name="id" />
                    <input type="hidden" name="fname" />
                        <label class="layui-form-label">岗位名称<span style="color: red">*</span></label>
                        <div class="layui-input-block">
                           <input type="text" name="jobname" id="jobname" lay-verify="required" placeholder="请输入岗位名称" autocomplete="off" class="layui-input">
                           <!-- <select name="jobname" id="jobname" lay-verify="required"  lay-filter="jobname_filter">-->
                        </select>
                        </div>
                </div>
                <div class="layui-form-item">
                    <input type="hidden" name="id" />
                    <input type="hidden" name="fname" />
                    <label class="layui-form-label">岗位类型<span style="color: red">*</span></label>
                    <div class="layui-input-block">
                        <input type="text" name="jobtype" id="jobtype" lay-verify="required" placeholder="请输入岗位类型" autocomplete="off" class="layui-input">
                         <!--<select name="jobtype" id="jobtype" lay-verify="required"  lay-filter="jobtype_filter">
                             <option value="">请选择岗位</option>
                             <option value="技术岗">技术岗</option>
                             <option value="管理岗">管理岗</option>
                             <option value="后勤岗">后勤岗</option>
                        </select>-->
                    </div>
                </div>
                <div class="layui-form-item">
                        <label class="layui-form-label">招聘人数<span style="color: red">*</span></label>
                        <div class="layui-input-block">
                            <input type="text" name="zpcount" id="zpcount" lay-verify="required" placeholder="请输入招聘人数" autocomplete="off" class="layui-input">
                        </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">学历要求<span style="color: red">*</span></label>
                    <div class="layui-input-block">
                        <!--<input type="hidden" id="edcode" name="edcode" />
                        <select name="eduname" id="eduname" lay-verify="required" >
                            <option value=""></option>
                            <option value="国民教育本科">国民教育本科</option>
                            <option value="普通全日制本科">普通全日制本科</option>
                            <option value="全日制硕士研究生">全日制硕士研究生</option>
                            <option value="博士研究生">博士研究生</option>
                        </select>-->
                        <input type="text" name="handoverEdcode" id="handoverEdcode" class="layui-input"
                               style="position:absolute;z-index:2;width:80%;border-right:none"  autocomplete="off">
                        <select name="edcode" id="edcode" lay-filter="edcode" datatype="*" nullmsg="学历不能为空！">
                      <!--      <option value="0">不限</option>-->
                        </select>
                        <input type="hidden" name="eduname" id="eduname"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">专业要求</label>
                    <div class="layui-input-block">
                        <textarea placeholder="请输入内容" class="layui-textarea" name="major"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">资格条件</label>
                    <div class="layui-input-block">
                        <textarea placeholder="请输入内容"  class="layui-textarea" name="workreq" style="min-height: 220px"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                        <label class="layui-form-label">性别要求</label>
                        <div class="layui-input-block" pane="">
                                <input type="radio" name="gender" value="不限" title="不限" checked="">
                                <input type="radio" name="gender" value="男" title="男">
                                <input type="radio" name="gender" value="女" title="女" >
                        </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">政治面貌</label>
                    <div class="layui-input-block">
                        <input type="text" name="handoverPolitical" id="handoverPolitical" class="layui-input"
                               style="position:absolute;z-index:2;width:80%;border-right:none"  autocomplete="off">
                        <select name="political" id="political" lay-filter="political" datatype="*" ></select>
                    </div>
                </div>

                <div class="layui-form-item">
                        <label class="layui-form-label">年龄要求</label>
                            <div class="layui-input-block" >
                                <input type="text" name="agef" placeholder="请输入年龄要求" autocomplete="off" class="layui-input">
                            </div>
                          <!--  <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline" style="width: 100px;">
                                <input type="text" name="aget" placeholder="" autocomplete="off" class="layui-input">
                            </div>-->
                </div>

                <div  class="layui-form-item">
                        <label class="layui-form-label">工作年限</label>
                        <div class="layui-input-block">
                            <input type="text" name="workyear" id="workyear" lay-verify="" placeholder="填最低工龄(单位:年),无要求留空" autocomplete="off" class="layui-input">
                        </div>
                </div>


                <div class="layui-form-item">
                        <label class="layui-form-label">身高要求</label>
                        <div class="layui-input-block">
                            <input type="text" name="height" id="height" lay-verify="" placeholder="填最低身高(单位:CM),无要求留空" autocomplete="off" class="layui-input">
                        </div>
                </div>
                <div class="layui-form-item">
                        <label class="layui-form-label">视力要求</label>
                        <div class="layui-input-block">
                            <input type="text" name="vision" id="vision" lay-verify="" placeholder="无要求请留空" autocomplete="off" class="layui-input">
                        </div>
                </div>


                <div class="layui-form-item">
                            <label class="layui-form-label">工作内容</label>
                            <div class="layui-input-block">
                                <textarea placeholder="请输入内容" class="layui-textarea" name="workcont"></textarea>
                            </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">另存为模板</label>
                    <div class="layui-input-block" pane="">
                      <!--  <input type="hidden" name="istemplate" value="否" id="hide_istemplate" />
                        <input type="checkbox"  id="cb_istemplate" lay-skin="switch" lay-filter="switchTemplate" lay-text="是|否" />-->
                        <input type="checkbox" name="istemplate" lay-skin="switch" lay-text="是|否">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">首页显示</label>
                    <div class="layui-input-block" pane="">

                        <input type="checkbox" name="display" lay-skin="switch" lay-text="是|否">
                       <!-- <input type="hidden" name="display" value="是" id="hide_display" />
                        <input type="checkbox" id="cb_display" checked=""  lay-skin="switch" lay-filter="switchDisplay" lay-text="是|否">-->

                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block" style="text-align: center">
<!--                        <button class="layui-btn blue-btn" lay-submit="" lay-filter="btn_flow_add" style="background-color: #1E85EC;color: #000;">保存</button>-->
<!--                        <button type="reset" class="layui-btn layui-btn-primary" id="btn_flow_reset" >重置</button>-->
                        <a class="rad-but">
                            <em class="ico16 save_traft_16"></em>
                            <span class="menu_span" title="保存" lay-submit lay-filter="btn_flow_add" >保存</span>
                        </a>
                        <button id="btn_flow_reset" class="rad-but" type="reset">
                            <em class="ico16 del16"></em>
                            <span class="menu_span" title="重置">重置</span>
                        </button>
                    </div>
                </div>
            </form>
        </div>
    </div>

</div>
<style type="text/css">
    .rad-but{
        text-align: center;
        background: #FFFFFF;
        border: 1px solid #d4d4d4;
        color: #666666;
        display: inline-block;
        padding: 0 10px;
        line-height: 30px;
        border-radius: 12px;
        margin: 0 0 0 15px;
        font-size: 12px;
        height: 30px;
    }
    .v-mid { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center; }

</style>
<script type="text/javascript" src="../../resources/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="../../resources/js/plugins/layui_exts/multSelect/multiSelect.js"></script>
    <script>
        var ptype = GetQueryString('ptype');
        var edcodeDat=null;
        var edcodeNum=null;
        var politicalDat=null;
        var politicalALL=[];

        var edats1 = [{'value':'0','dat':'不限'},{'value':'10','dat':'博士研究生'},{'value':'11','dat':'硕士研究生'},
            {'value':'14','dat':'全日制本科'},{'value':'31','dat':'非全日制本科'}];
        var edats2 = [{'value':'0','dat':'不限'},{'value':'15','dat':'全日制专科'},{'value':'32','dat':'非全日制专科'},
            {'value':'16','dat':'高职'},{'value':'17','dat':'中专'},{'value':'18','dat':'技校'},{'value':'19','dat':'职高'},
            {'value':'20','dat':'普高'},{'value':'22','dat':'其它'}];
        var edats3 = [{'value':'0','dat':'不限'},{'value':'10','dat':'博士研究生'},{'value':'11','dat':'硕士研究生'},
            {'value':'14','dat':'全日制本科'},{'value':'31','dat':'非全日制本科'},{'value':'15','dat':'全日制专科'},
            {'value':'32','dat':'非全日制专科'},{'value':'16','dat':'高职'},{'value':'17','dat':'中专'},
            {'value':'18','dat':'技校'},{'value':'19','dat':'职高'},{'value':'20','dat':'普高'},{'value':'22','dat':'其它'}];

        // 只需要引入multiSelect模块即可
        var index=parent.layer.getFrameIndex(window.name);
        var editData;

        layui.config({
            base: '../../resources/js/plugins/layui_exts/multSelect/'
        });

        layui.use(['multiSelect','form','table'],function(){
            var $=layui.$
                ,table=layui.table
                ,form=layui.form;
            // 如果异步操作了数据，比如在下拉项追加了一项，使用multiSelect.render(type, filter);type, filter参数跟layui官方的form.render(type, filter)一毛一样，可前往查看
            //multiSelect.render('eduname', null);

            $.post("/SysAdmin/getPoliticals",null,function (data) {
                if(data.state){
                    var datas=data.datas;
                    politicalALL = datas;
                    $("#political").empty();
                    if(politicalDat!=null)
                        $("#political").append(new Option(politicalDat,politicalDat));
                    else
                        $("#political").append(new Option("请选择政治面貌",""));
                    $(datas).each(function (i,item) {
                        if(item.name != politicalDat)
                            $("#political").append(new Option(item.name,item.name));
                    });
                    layui.form.render("select");
                }
            },"JSON");

            /* $.post("/SysAdmin/getJobsJson",null,function (data) {
                if(data.state){
                    var datas=data.datas;
                    $("#jobname").empty();
                    $("#jobname").append(new Option("请选择岗位",""));
                    $(datas).each(function (i,item) {
                        $("#jobname").append(new Option(item.name,item.name));
                    });
                    layui.form.render("select");
                }
            },"JSON");*/

            /*form.on('select(jobname_filter)', function(data){
                var jobnameSelect =  data.value;
                $("#jobtype").empty();
                $.post("/SysAdmin/getTypesJson",{jobnameSelect:jobnameSelect},function (data) {
                    if(data.state){
                        var type=data.datas.type;
                        $("#jobtype").empty();
                      //  $("#jobtype").append(new Option("请选择岗位",""));
                        $("#jobtype").append(new Option(data.datas.type,data.datas.type));
                       /!* if(type === 0)
                            $("#jobtype").append(new Option("技术岗","技术岗"));
                        else if(type === 1)
                            $("#jobtype").append(new Option("管理岗","管理岗"));
                        else if(type === 2)
                            $("#jobtype").append(new Option("后勤岗","后勤岗"));*!/
                        layui.form.render("select");
                    }
                },"JSON");
            });*/

            form.on('select(edcode)', function(data){
            //    $('input[name=eduname]').val($('select[name=edcode]').find("option:selected").text());

                var select_text = data.elem[data.elem.selectedIndex].text;
                $("#handoverEdcode").val(select_text );
                $("#edcode").next().find("dl").css({ "display": "none" });
                form.render();
            });

            $('#handoverEdcode').bind('input propertychange', function () {
                var value = $("#handoverEdcode").val();
                $("#edcode").val(value);
                form.render();
                $("#edcode").next().find("dl").css({ "display": "block" });
                var dl = $("#edcode").next().find("dl").children();
                var j = -1;
                for (var i = 0; i < dl.length; i++) {
                    if (dl[i].innerHTML.indexOf(value) <= -1) {
                        dl[i].style.display = "none";
                        j++;
                    }
                    if (j == dl.length-1) {
                        $("#edcode").next().find("dl").css({ "display": "none" });
                    }
                }
            });

            form.on('select(political)', function(data){
                var select_text = data.elem[data.elem.selectedIndex].text;
                $("#handoverPolitical").val(select_text );
                $("#political").next().find("dl").css({ "display": "none" });
                form.render();
            });


            $('#handoverPolitical').bind('input propertychange', function () {
                var value = $("#handoverPolitical").val();
                $("#political").val(value);
                form.render();
                $("#political").next().find("dl").css({ "display": "block" });
                var dl = $("#political").next().find("dl").children();
                var j = -1;
                for (var i = 0; i < dl.length; i++) {
                    if (dl[i].innerHTML.indexOf(value) <= -1) {
                        dl[i].style.display = "none";
                        j++;
                    }
                    if (j == dl.length-1) {
                        $("#political").next().find("dl").css({ "display": "none" });
                    }
                }
            });


            layui.use('table', function(){
                var  tables = layui.table;

                tables.render({
                    id:'jobsPlanTempTable'
                    ,elem: '#jobsPlanTempTable'
                    //,url: '/ProjectJobTemplate/findPlans'
                    ,url: '/ProjectJobTemplate/findByName?ptype='+ptype
                    ,title:'用户数据表'
                    , height: 'full'
                    ,cellMinWidth: 40 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
                    ,cols: [[ {field: 'id', title: 'id', width: 60, sort: false, hide: true}
                        , {field: 'jobdepart', title: '部门名称', sort: false, minWidth: 80}
                        , {field: 'jobname', title: '岗位名称', sort: false, minWidth: 80}
                        , {field: 'count', title: '人数',sort: false}
                        , {field: 'age', title: '年龄', sort: false, hide: true}
                        , {field: 'educode', title: '学历', sort: false, hide: true}
                        , {field: 'major', title: '专业', sort: false, hide: true}
                        , {field: 'requirement', title: '其他方面要求', minWidth: 100, hide: true}
                        , {field: 'jobcontent', title: '工作内容', minWidth: 100, hide: true}
                        , {field: 'jobtype', title: '岗位类型', sort: false}
                        , {field: 'political', title: '政治面貌', sort: false, hide: true}
                        , {field: 'educoderequ', title: '工作学历要求', sort: false, hide: true, hide: true}
                       ]]
                    ,page: true
                });

                $("#flows_searchbtn").on('click', () => {
                    //执行重载
                    tables.reload('jobsPlanTempTable', {
                        url: '/ProjectJobTemplate/findByName?ptype='+ptype
                        ,method: 'get'
                        ,page:  {
                            curr: 1 //重新从第 1 页开始
                        }
                        ,where: {
                          //  pname: $('#search_jobplanname').val(),
                        }
                    }, 'data');
                });

                tables.on('row(jobsPlanTempTable)', function(obj){
                    // console.log(obj.tr) //得到当前行元素对象
                    // console.log(obj.data) //得到当前行数据
                    //obj.del(); //删除当前行
                    //obj.update(fields) //修改当前行数据
                    var selectData=obj.data;

                    var jobnameSelect =  selectData.jobname;

                    /*var items = -1;
                    $.post("/SysAdmin/getJobsJson",null,function (data) {
                        if(data.state){
                            items = -1;
                            var datas=data.datas;
                            $("#jobname").empty();
                            $("#jobname").append(new Option("请选择岗位",""));
                            $(datas).each(function (i,item) {
                                $("#jobname").append(new Option(item.name,item.name));
                                if(item.name == selectData.jobname)
                                    items = i;
                            });
                            if(items == -1)
                                $("#jobname").append(new Option(selectData.jobname,selectData.jobname));
                           // $("#jobname").value(selectData.jobname);
                            layui.form.render("select");
                            form.val('jobsForm',{
                                "jobname": selectData.jobname
                            });
                        }
                    },"JSON");*/

                    /*  var types = 0;
                      $.post("/SysAdmin/getTypesJson",{jobnameSelect:jobnameSelect},function (data) {
                          if(data.state){
                              types=data.datas.type;
                              var typeTemp ="";
                              $("#jobtype").empty();
                              //  $("#jobtype").append(new Option("请选择岗位",""));
                              $("#jobtype").append(new Option(data.datas.type,data.datas.type));
                              typeTemp = data.datas.type;

                              form.val('jobsForm',{
                                  "jobtype": typeTemp
                              });
                          }else{
                              $("#jobtype").empty();
                              $("#jobtype").append(new Option("请选择岗位",""));
                              $("#jobtype").append(new Option("技术岗","技术岗"));
                              $("#jobtype").append(new Option("管理岗","管理岗"));
                              $("#jobtype").append(new Option("后勤岗","后勤岗"));
                              form.val('jobsForm',{
                                  "jobtype": ""
                              });
                          }
                      },"JSON");*/

                    form.val('jobsForm',{
                        "jobdepart": selectData.jobdepart
                        ,"jobname": selectData.jobname
                        ,"jobtype":selectData.jobtype
                        ,"zpcount": selectData.count
                        ,"eduname": selectData.educode
                        ,"major": selectData.major
                        ,"workreq": ""
                        ,"gender": "不限"
                        ,"political":selectData.political
                        ,"agef": selectData.age
                       // ,"aget": ""
                        ,"workyear": ""
                        ,"height": ""
                        ,"vision": ""
                        ,"workcont":selectData.jobcontent
                        ,"display": selectData.display
                        ,"handoverEdcode":selectData.educode
                        ,"handoverPolitical":selectData.political
                    });
                    form.render();
                    //multiSelect.render('eduname', null);
                });
            });

            form.on('submit(btn_flow_add)', function(data){
              //  console.log(data.field) //当前容器的全部表单字段，名值对形式：{name: value}
               var tabledatas= parent.layui.table.cache['jobsTable'];
                var hasjob=false;
                var hasIndex=1;

                if(data.field.eduname!==data.field.handoverEdcode)
                    data.field.eduname = data.field.handoverEdcode;

                if(data.field.political!==data.field.handoverPolitical)
                    data.field.political = data.field.handoverPolitical;

                if(data.field.display === "on") {
                    data.field.display = "是";
                } else {
                    data.field.display = "否";
                }
                if(data.field.istemplate === "on") {
                    data.field.istemplate = "是";
                } else {
                    data.field.istemplate = "否";
                }
                $.each(tabledatas,function(e,t) {

                    if(!!editData){
                        if (t.jobname===editData.jobname){
                            hasjob=true;
                            hasIndex=e;
                        }
                    }
                });
                if(!!editData){
                    tabledatas[hasIndex]=data.field;
                    parent.layui.table.cache['jobsTable'][hasIndex]=data.field;
                    parent.layui.table.reload('jobsTable',{data:tabledatas});
                    parent.layer.close(index);
                }else{
                    if(hasjob){
                        layer.alert('已存在该岗位,请更换岗位名称!',{icon:5});
                    }else{
                        tabledatas.splice(hasIndex+1, 0, data.field);
                        parent.layui.table.cache['jobsTable']=tabledatas;
                        parent.layui.table.reload('jobsTable',{data:tabledatas});
                        parent.layer.close(index);
                    }
                }
                return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
            });

            if(!!editData){
                editJob(editData);
            }
            function editJob(cdata) {
                edcodeDat = cdata.eduname;
                politicalDat = cdata.political;

                for(var i=0;i<edats3.length;i++){
                    if(edats3[i].dat===edcodeDat){
                        edcodeNum = edats3[i].value;
                        break;
                    }
                }

                layui.form.val('jobsForm',{
                    "jobdepart": cdata.jobdepart
                    ,"jobname": cdata.jobname // "name": "value"
                    ,"zpcount": cdata.zpcount
                    ,"jobtype":cdata.jobtype
                    ,"educode": cdata.educode
                    ,"eduname": cdata.eduname
                    ,"major": cdata.major
                    ,"workreq": cdata.workreq
                    ,"workcont":cdata.workcont
                    ,"height": cdata.height
                    ,"gender": cdata.gender
                    ,"political":cdata.political
                    ,"vision": cdata.vision
                    ,"workyear": cdata.workyear
                    ,"agef": cdata.agef
                  //  ,"aget": cdata.aget
                    ,"display": cdata.display
                    ,"istemplate": cdata.istemplate
                    ,"handoverEdcode":cdata.eduname
                    ,"handoverPolitical":cdata.political
                } );

                if(cdata.display==='是'){
                    $('#cb_display').attr('checked','checked');
                }else{
                    $('#cb_display').removeAttr('checked');
                }
                if(cdata.istemplate==='是'){
                    $('#cb_istemplate').attr('checked','checked');
                }else{
                    $('#cb_istemplate').removeAttr('checked');
                }
                layui.form.render();

                $("#edcode").append(new Option(edcodeDat,edcodeNum));
                $(edats3).each(function (i,item) {
                    if(item.dat !== edcodeDat)
                        $("#edcode").append(new Option(item.dat,item.value));
                });

                $("#political").append(new Option(politicalDat,politicalDat));
                for(var i=0;i<politicalALL.length;i++){
                    if(politicalALL[i] !== politicalDat)
                        $("#political").append(new Option(politicalALL[i],politicalALL[i]));
                }

                /*switch(ptype){
                    case "1" ://高校招聘
                        $("#edcode").append(new Option(edcodeDat,edcodeNum));
                        $(edats1).each(function (i,item) {
                            if(item.dat != edcodeDat)
                                $("#edcode").append(new Option(item.dat,item.value));
                        });
                        break;
                    case "2" ://中专招聘
                        $("#edcode").append(new Option(edcodeDat,edcodeNum));
                        $(edats2).each(function (i,item) {
                            if(item.dat != edcodeDat)
                                $("#edcode").append(new Option(item.dat,item.value));
                        });
                        break;
                    case "3" ://社会招聘
                        $("#edcode").append(new Option(edcodeDat,edcodeNum));
                        $(edats3).each(function (i,item) {
                            if(item.dat != edcodeDat)
                                $("#edcode").append(new Option(item.dat,item.value));
                        });
                        break;
                    default :break;
                }*/
            }
        });


    </script>
</body>
</html>